Skip to content

06-CG-Texture Mapping

Texture Mapping

  • Adds visual detail to scenes
  • Without raising geometric complexity
  • A shading trick makes a surface look textured

Basic idea: use images instead of more polygons to represent fine scale color variation

Q: How do we decide where on the geometry each color from the image should go?

  • 1st Option: unfold the surface
  • 2nd Option: make an atlas
  • 3rd Option: depending on artist's design

Types of projections

▪ Interpolating texture coor

Q: How to map object to texture?

To each vertex (x,y,z in object coordinates), must associate 2D texture coordinates (s,t)

Map shapes correspond to various projections

  • Planar, Cylindrical, Spherical
  • First, map (square) texture to basic map shape
  • Then, map basic map shape to object
    • Or vice versa: Object to map shape, map shape to square
  • Usually, this is straightforward
    • Maps from square to cylinder, plane, sphere well defined
    • Maps from object to these are simply spherical, cylindrical, cartesian coordinate systems

Planar mapping

Like projections, drop z coord (s,t)=(x,y)

2qpt8M

Cylindrical Mapping

Cylinder: r,θ,y with(s,t)=(θ2π,y)

Gi7euE

Spherical Mapping

Convert to spherical coordinates: use latitude/long.

  • Singularities at north and south poles

xfRYqT

Cube Mapping

Cube mapping uses six square textures that represent the faces of a cube. These are typically labeled as (+X, -X, +Y, -Y, +Z, -Z). The cube is imagined to be surrounding either the object or the entire scene.

1W42EZ

  • Each face is like a camera looking in one of the six axis-aligned directions.
  • The environment or a reflection is “stored” on these six faces.

Interpolating texture coordinates